import Vue from "vue";

// 按钮节流指令
Vue.directive("preventReClick", {
    async inserted(el, binding) {
  
      el.addEventListener("click", () => {

        if (!el.disabled) {

          el.disabled = true;
  
          setTimeout(() => {

            el.disabled = false;
          }, binding.value || 2000);
        }
      });
    }
  });